Skip to content

Enhancement/upload multiple files #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Dashing-Nelson
Copy link

This pull request introduces support for uploading multiple specific files to Google Cloud Storage by allowing paths to be specified using newline-separated values or YAML pipe syntax. It also includes updates to the documentation, refactoring of the codebase to handle multiple paths, and new tests to ensure functionality.

Feature Addition: Support for Multiple File Uploads

  • src/util.ts: Added the processMultiplePaths function to handle multiple paths specified in the path input, allowing users to upload multiple specific files by separating paths with newlines. This includes logic for handling single paths and deduplicating files.
  • src/main.ts: Refactored the run function to use processMultiplePaths for processing multiple paths and updating related variables such as files, absoluteRoot, and givenRoot. [1] [2] [3] [4] [5]

Documentation Updates

  • README.md: Added a new section, "Upload Multiple Files," with examples demonstrating how to use newline-separated values or YAML pipe syntax to specify multiple paths for file uploads.
  • action.yml: Updated the description of the path input to clarify that multiple paths can be specified using newlines, with examples provided. [1] [2]

Testing Enhancements

  • tests/multiple-paths.test.ts: Added comprehensive tests for the new functionality, including scenarios for uploading multiple files, handling empty lines, and verifying single-path behavior. Mocking and assertions ensure correctness.

- Updated the `run` function in `main.ts` to use `processMultiplePaths` for handling the 'path' input, allowing multiple paths separated by newlines.
- Removed the previous logic for computing absolute root and glob expansion, replacing it with the new function.
- Adjusted file processing to use the given root from the new function.
- Introduced `processMultiplePaths` in `util.ts` to manage multiple paths, compute absolute roots, and expand globs for each path.
- Ensured that the final list of files is unique and relative to the GitHub workspace.
@Dashing-Nelson Dashing-Nelson requested a review from a team as a code owner July 25, 2025 10:43
Copy link

google-cla bot commented Jul 25, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Dashing-Nelson
Copy link
Author

resolves #386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant